package com.demo2do.fms.entity.supplier.ware;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.core.format.PersistentFormat;
import com.demo2do.fms.entity.supplier.common.Supplier;

/**
 * @description:
 * @author: 11200
 * @date: 2019/7/22
 */
@Entity
@Table
@DynamicUpdate
public class CommonWareSupplier {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "generator")
    @SequenceGenerator(name = "generator", sequenceName = "HIBERNATE_SEQUENCE", allocationSize = 1)
    private Long id;

    /**
     * 与supplier关联
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @PersistentFormat
    private Supplier supplier;




    /** 创建者 */
    private Long creator;

    /** 创建时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 最后修改者 */
    private Long lastOperator;

    /** 最近修改时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastModifyTime;

    /** 是否注销 */
    @Column(name = "IS_DISABLED")
    private Boolean disabled;

}
